<head>

<title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 <link rel="stylesheet" href="model.css" />
  <?php include("head.php"); ?>
 <?php include("entete.php"); ?>
   <?php include("menu.php"); ?>
<?php

  //connection au serveur:
try{
  $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  $bdd = new PDO('mysql:host='.DB_SERVER.';dbname='.DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, $pdo_options);
  
    
    $reponse = $bdd->query('SELECT NOM_ASSOC, ID_ASSOC FROM ASSOCIATION ORDER BY NOM_ASSOC');
 

    //affichage des données:
while( $donnees = $reponse->fetch() )
  {
    echo(
           "<div align=\"center\">"
           .$donnees['NOM_ASSOC'].
           " <a href=\"print_association.php?idAssociation=".$donnees['ID_ASSOC']."\">afficher</a> 
<a href=\"modif1_assoc.php?idAssociation=".$donnees['ID_ASSOC']."\">modifier</a>  <a href=\"del_assoc.php?idAssociation=".$donnees['ID_ASSOC']."&nom_assoc=".$donnees['NOM_ASSOC']."\">supprimer</a></div>"
       ) ;
    }
 $reponse->closeCursor();
}
catch (Exception $e)
{
  die('Erreur : ' . $e->getMessage());
} 
?>


<?php include("pied_de_page.php"); ?>